package com.example.springboot;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.ConfigurableEnvironment;


@Slf4j
@SpringBootApplication
public class ApiApplication {

    public static void main(String[] args) {
        ConfigurableEnvironment env = SpringApplication.run(ApiApplication.class, args).getEnvironment();
        String applicationName = env.getProperty("spring.application.name");
        String serverPort = env.getProperty("server.port");
        String serverIp = env.getProperty("ip");

        log.info("""
                
                +--------------------------------------------------------+
                 Application: '{}' is running Success!
                 Local URL:    http://{}:{}
                 Document:     http://{}:{}/doc.html
                +--------------------------------------------------------+
                """, applicationName, serverIp, serverPort, serverIp, serverPort);
    }

}
